package com.zenika.zenbinding.client.converter;

/**
 * Converter factory which provides basic converters. To get an instance, call
 * the getInstance method.
 * @author Zenika
 */
public class Converters {

	public IntegerConverter INTEGER;
	public FloatConverter FLOAT;
	public DoubleConverter DOUBLE;
	public ByteConverter BYTE;
	public StringConverter STRING;
	public BooleanConverter BOOLEAN;
	public ShortConverter SHORT;
	public CharacterConverter CHARACTER;
	public DateConverter DATE;
	public LongConverter LONG;
	

	private static Converters converters;

	private Converters() {
		this.INTEGER = new IntegerConverter();
		this.FLOAT = new FloatConverter();
		this.DOUBLE = new DoubleConverter();
		this.BYTE = new ByteConverter();
		this.STRING = new StringConverter();
		this.BOOLEAN = new BooleanConverter();
		this.SHORT = new ShortConverter();
		this.CHARACTER = new CharacterConverter();
		this.DATE = new DateConverter();
		this.LONG = new LongConverter();
	}

	/**
	 * Get an instance of the Converters class.
	 * @return Converters
	 */
	public static Converters getInstance() {
		if (converters == null) {
			converters = new Converters();
		}
		return converters;
	}
}
